package com.hnas.common.service.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.hnas.common.orm.ImportDataPool;
import com.hnas.common.service.dto.DTOImportDataPool;
import com.hnas.core.mapper.Mapper;

public class ImportDataPoolMapper extends Mapper<DTOImportDataPool, ImportDataPool> {
	private static ImportDataPoolMapper ImportDataPoolMapper;

	private ImportDataPoolMapper() {
		super(DTOImportDataPool.class, ImportDataPool.class);
	}

	public static ImportDataPoolMapper getInstance() {
		if (ImportDataPoolMapper == null) {
			ImportDataPoolMapper = new ImportDataPoolMapper();
		}
		return ImportDataPoolMapper;
	}

	public DTOImportDataPool mapToValue(ImportDataPool vo) {
		DTOImportDataPool dto = new DTOImportDataPool();
		BeanUtils.copyProperties(vo, dto);
		return dto;
	}

	public List<DTOImportDataPool> mapToValues(List<ImportDataPool> list) {
		List<DTOImportDataPool> dtoList = new ArrayList<DTOImportDataPool>();
		for (ImportDataPool vo : list) {
			DTOImportDataPool dto = this.mapToValue(vo);
			dtoList.add(dto);
		}
		return dtoList;
	}
}
